package com.xyht.sca_s.student_manage_system.modules.visitor.controller;


import com.xyht.sca_s.student_manage_system.common.annotation.VisitorRequestCheck;
import com.xyht.sca_s.student_manage_system.common.commonReturn.ResponseResult;
import com.xyht.sca_s.student_manage_system.common.desEncodeAndDecode.annotation.SecretBody;
import com.xyht.sca_s.student_manage_system.modules.visitor.entity.vo.SmsVisitorRegisterDetailVO;
import com.xyht.sca_s.student_manage_system.modules.visitor.service.SmsVisitorRegisterDetailService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author XYHT
 * @since 2023-04-18
 */
@SecretBody
@VisitorRequestCheck
@RestController
@RequestMapping("/visitor/smsVisitorRegisterDetail")
public class SmsVisitorRegisterDetailController {
    @Autowired
    SmsVisitorRegisterDetailService smsVisitorRegisterDetailService;
    @ApiOperation("新增流程详情")
    @PostMapping("/smsVisitorRegisterDetailAdd")
    public ResponseResult smsVisitorRegisterDetailAdd(@RequestBody SmsVisitorRegisterDetailVO smsVisitorRegisterDetail){
        return smsVisitorRegisterDetailService.smsVisitorRegisterDetailAdd(smsVisitorRegisterDetail);
    }
    @ApiOperation("删除流程详情")
    @DeleteMapping("/deleteSmsVisitorRegisterDetail")
    public ResponseResult deleteSmsVisitorRegisterDetail(@RequestBody SmsVisitorRegisterDetailVO smsVisitorRegisterDetail){
        return smsVisitorRegisterDetailService.deleteSmsVisitorRegisterDetail(smsVisitorRegisterDetail);
    }
    @ApiOperation("修改流程详情")
    @PostMapping("/updateSmsVisitorRegisterDetail")
    public ResponseResult updateSmsVisitorRegisterDetail(@RequestBody SmsVisitorRegisterDetailVO smsVisitorRegisterDetail){
        return smsVisitorRegisterDetailService.updateSmsVisitorRegisterDetail(smsVisitorRegisterDetail);
    }
    @ApiOperation("查询流程详情")
    @GetMapping("/selectSmsVisitorRegisterDetail")
    public ResponseResult selectSmsVisitorRegisterDetail(@RequestParam(value = "search_str", required = false) String search_str,
                                               @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
                                               @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                               @RequestParam(value = "bg_date", required = false) String bg_date,
                                               @RequestParam(value = "end_date", required = false) String end_date) {
        return smsVisitorRegisterDetailService.selectSmsVisitorRegisterDetail(search_str,pageSize, pageNum,bg_date,end_date);
    }
    @ApiOperation("通过ID查询流程详情")
    @GetMapping("/selectSmsVisitorRegisterDetailById")
    public ResponseResult selectSmsVisitorRegisterDetailById(@RequestParam(value = "id", required = false) String id
    ) {
        return smsVisitorRegisterDetailService.selectSmsVisitorRegisterDetailById(id);
    }
}

